package

        com.rfid.system.service.impl;

import java.util.List;
import java.util.Map;

import com.rfid.common.utils.DateUtils;
import com.rfid.system.domain.TItemInfo;
import com.rfid.system.domain.request.GetOrderInfosVO;
import com.rfid.system.domain.request.TItemInfoAndProduct;
import com.rfid.system.domain.response.DocumentInfoResponseVO;
import com.rfid.system.domain.response.TItemInfoResponseVO;
import com.rfid.system.mapper.TItemInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rfid.system.service.ITIteminfoService;
import com.rfid.common.core.text.Convert;

/**
 * 成品Service业务层处理
 *
 * @author ruoyi
 * @date 2020-11-27
 */
@Service
public class TIteminfoServiceImpl implements ITIteminfoService {

    @Autowired
    private TItemInfoMapper tIteminfoMapper;

    /**
     * 查询成品
     *
     * @param id 成品ID
     * @return 成品
     */
    @Override
    public TItemInfo selectTIteminfoById(Long id) {
        return tIteminfoMapper.selectTIteminfoById(id);
    }

    /**
     * 查询成品列表
     *
     * @param tIteminfo 成品
     * @return 成品
     */
    @Override
    public List<TItemInfo> selectTIteminfoList(TItemInfo tIteminfo) {
        return tIteminfoMapper.selectTIteminfoList(tIteminfo);
    }

    /**
     * 新增成品
     *
     * @param tIteminfo 成品
     * @return 结果
     */
    @Override
    public int insertTIteminfo(TItemInfo tIteminfo) {
        tIteminfo.setCreateTime(DateUtils.getNowDate());
        return tIteminfoMapper.insertTIteminfo(tIteminfo);
    }

    /**
     * 修改成品
     *
     * @param tIteminfo 成品
     * @return 结果
     */
    @Override
    public int updateTIteminfo(TItemInfo tIteminfo) {
        tIteminfo.setUpdateTime(DateUtils.getNowDate());
        return tIteminfoMapper.updateTIteminfo(tIteminfo);
    }

    /**
     * 删除成品对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTIteminfoByIds(String ids) {
        return tIteminfoMapper.deleteTIteminfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除成品信息
     *
     * @param id 成品ID
     * @return 结果
     */
    @Override
    public int deleteTIteminfoById(Long id) {
        return tIteminfoMapper.deleteTIteminfoById(id);
    }

    @Override
    public TItemInfo getLastData(TItemInfo info) {
        return tIteminfoMapper.getLastData(info);
    }

    @Override
    public Map<String, Object> getOrderInfos(GetOrderInfosVO getOrderInfos) {
        return tIteminfoMapper.getOrderInfos(getOrderInfos);
    }

    @Override
    public List<TItemInfoAndProduct> selectTitemInfoAndProducts(TItemInfo tItemInfo) {
        return tIteminfoMapper.selectTitemInfoAndProducts(tItemInfo);
    }

    @Override
    public List<DocumentInfoResponseVO> selectByEpc(String epc) {
        return tIteminfoMapper.selectByEpc(epc);
    }

    @Override
    public List<TItemInfoResponseVO> getItemByEpc(String epc) {
        return tIteminfoMapper.getItemByEpc(epc);
    }
}
